﻿namespace ZhiAo.WebLib.Data
{
    using ZhiAo.BaseFramework.DBConnection;
    using System;
    using System.Collections;
    using System.Data;
    using System.Text;

    public abstract class BaseManagement
    {
        private static Hashtable dbContainer;
        private string productTag;

        public BaseManagement(string ProductTag)
        {
            this.productTag = ProductTag;
        }

        private ZhiAo.BaseFramework.DBConnection.DB GetDatabaseByProductTag(string ProductTag)
        {
            ZhiAo.BaseFramework.DBConnection.DB db = null;
            return db;
        }

        public static ZhiAo.BaseFramework.DBConnection.DB GetDB(string ProductTag)
        {
            ConnectionType connType = ConnectionType.ORA;
            if (ZhiAo.CoreLibrary.PlatformInfo.DBType == ZhiAo.CoreLibrary.DBType.SqlServer) connType = ConnectionType.SQL;
            ZhiAo.BaseFramework.DBConnection.DB db = new ZhiAo.BaseFramework.DBConnection.DB(DB.StaticConnectionString, connType);
            return db;
        }


        public ZhiAo.BaseFramework.DBConnection.DB BusinessDB
        {
            get
            {
                return this.GetDatabaseByProductTag(this.productTag);
            }
        }

        private Hashtable DbContainer
        {
            get
            {
                if (dbContainer == null)
                {
                    dbContainer = new Hashtable();
                }
                return dbContainer;
            }
        }

      
    }
}

